<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>前台模板</title>
    <link href="static/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #4e73df;
            --secondary-color: #858796;
            --light-color: #f8f9fc;
            --dark-color: #5a5c69;
        }

        body {
            font-family: 'Nunito', sans-serif;
            background-color: var(--light-color);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            margin: 0;
        }

        .navbar {
            background-color: var(--primary-color);
            padding: 0.75rem 1rem;
        }

        .navbar-brand {
            color: #fff;
            font-weight: 700;
            font-size: 1.2rem;
        }

        .navbar-nav .nav-link {
            color: rgba(255, 255, 255, 0.8) !important;
            padding: 1rem 1.5rem;
            transition: all 0.3s;
        }

        .navbar-nav .nav-link:hover,
        .navbar-nav .nav-link.active {
            color: #fff !important;
            background-color: rgba(255, 255, 255, 0.1);
        }

        .main-content {
            flex-grow: 1;
            display: flex;
            justify-content: center;
            align-items: stretch;
            padding: 1.5rem;
        }

        iframe {
            width: 100%;
            border: none;
            background-color: #fff;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
            border-radius: 0.35rem;
        }

        .footer {
            background-color: var(--dark-color);
            color: #fff;
            text-align: center;
            padding: 1rem;
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg">
    <div class="container-fluid">
        <a class="navbar-brand" href="#">前台系统</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav mx-auto">
                <li class="nav-item">
                    <a class="nav-link active" href="#" onclick="loadPage('front_home.jsp')">主页</a>
                </li>
                <!-- 其他导航项 -->
            </ul>
        </div>
    </div>
</nav>

<div class="main-content">
    <iframe id="mainFrame" src="front_home.jsp" onload="resizeIframe(this)"></iframe>
</div>

<footer class="footer">
    &copy; 2024 网站名称. 版权所有.
</footer>

<script src="static/bootstrap/jquery-3.5.1.slim.min.js"></script>
<script src="static/bootstrap/popper.min.js"></script>
<script src="static/bootstrap/bootstrap.min.js"></script>
<script>
    function loadPage(page) {
        var iframe = document.getElementById('mainFrame');
        iframe.src = page;
    }

    function resizeIframe(obj) {
        obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';
    }

    // 为导航项添加点击事件，更新活动状态
    document.querySelectorAll('.nav-link').forEach(link => {
        link.addEventListener('click', function() {
            document.querySelectorAll('.nav-link').forEach(el => el.classList.remove('active'));
            this.classList.add('active');
        });
    });
</script>
</body>
</html>